Filename | (eval 73)[/usr/share/perl5/CGI.pm:932] |
Statements | Executed 16 statements in 25µs |
Eval Invoked At | /usr/share/perl5/CGI.pm line 932 |
Sibling evals | 1, 2, 3, 4, 5, 6 |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 21µs | 24µs | read_from_cmdline | CGI::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # spent 24µs (21+3) within CGI::read_from_cmdline which was called:
# once (21µs+3µs) by CGI::init at line 895 of CGI.pm | ||||
2 | 1 | 100ns | my($input,@words); | ||
3 | my($query_string); | ||||
4 | my($subpath); | ||||
5 | 1 | 1µs | if ($DEBUG && @ARGV) { | ||
6 | @words = @ARGV; | ||||
7 | } elsif ($DEBUG > 1) { | ||||
8 | require Text::ParseWords; | ||||
9 | print STDERR "(offline mode: enter name=value pairs on standard input; press ^D or ^Z when done)\n"; | ||||
10 | chomp(@lines = <STDIN>); # remove newlines | ||||
11 | $input = join(" ",@lines); | ||||
12 | @words = &Text::ParseWords::old_shellwords($input); | ||||
13 | } | ||||
14 | 1 | 600ns | for (@words) { | ||
15 | 5 | 6µs | 5 | 1µs | s/\\=/%3D/g; # spent 1µs making 5 calls to CGI::CORE:subst, avg 260ns/call |
16 | 5 | 6µs | 5 | 500ns | s/\\&/%26/g; # spent 500ns making 5 calls to CGI::CORE:subst, avg 100ns/call |
17 | } | ||||
18 | |||||
19 | 1 | 5µs | 1 | 800ns | if ("@words"=~/=/) { # spent 800ns making 1 call to CGI::CORE:match |
20 | $query_string = join('&',@words); | ||||
21 | } else { | ||||
22 | $query_string = join('+',@words); | ||||
23 | } | ||||
24 | 1 | 2µs | 1 | 300ns | if ($query_string =~ /^(.*?)\?(.*)$/) # spent 300ns making 1 call to CGI::CORE:match |
25 | { | ||||
26 | $query_string = $2; | ||||
27 | $subpath = $1; | ||||
28 | } | ||||
29 | 1 | 4µs | return { 'query_string' => $query_string, 'subpath' => $subpath }; | ||
30 | } | ||||
31 | |||||
32 | ; |